package com.albaba.designpattern.builder.text_001.director;

import com.albaba.designpattern.builder.text_001.builder.Builder;
import com.albaba.designpattern.builder.text_001.entity.Bike;

/**
 * @author zx
 * @version 1.0
 * @description 指挥者类
 * @date 2025/2/19 20:38
 */
public class Director {

    private Builder mBuilder;

    public Director(Builder builder) {
        this.mBuilder = builder;
    }

    // 组装自行车
    public Bike construct() {
        mBuilder.buildFrame();
        mBuilder.buildSeat();
        return mBuilder.createBike();
    }
}
